﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp__2._3._3
{
    class Program
    {
        static void Main(string[] args)
        {
            var age = new List<student>()
                 {
                     new student{Id=1,Name="张珊",isLiberal=false,Chinese=127,Math=145,English=122,Comprehensive=289},
                     new student{Id=2,Name="刘亮",isLiberal=true,Chinese=103,Math=145,English=122,Comprehensive=250},
                     new student{Id=3,Name="薛贵",isLiberal=true,Chinese=136,Math=102,English=89,Comprehensive=189},
                     new student{Id=4,Name="吴迪",isLiberal=true,Chinese=126,Math=98,English=140,Comprehensive=238}
                 };
            var ds = age.Where(n => n.isLiberal == true).Average(n => n.Chinese + n.Math + n.English + n.Comprehensive);
            Console.WriteLine(ds);
            Console.ReadLine();
        }
        
    }
}
